package com.caishi.lkx.user.service.impl;

import com.caishi.lkx.user.mapper.AgentLevelMapper;
import com.caishi.lkx.user.model.AgentLevelModel;
import com.caishi.lkx.user.service.IAgentLevelService;
import com.zzw.common.entity.IBaseMapper;

import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @Author: huangpeng
 * @Date: 2021/9/23 9:37
 * @Description:
 */
@Service
//@DubboService(interfaceClass = IAgentLevelBaseService.class)
public class AgentLevelServiceImpl implements IAgentLevelService {
    @Resource
    private AgentLevelMapper agentLevelMapper;

    @Override
    public IBaseMapper<AgentLevelModel, String> getMapper() {
        return agentLevelMapper;
    }


//    @Override
//    public Map<String, Object> rpcSearch(Long current, Long size, RpcAgentLevelModel rpcAgentLevelModel) {
//        Page<AgentLevelModel> page = new Page<>();
//        page.setCurrent(current);
//        page.setSize(size);
//        IPage<AgentLevelModel> modelIPage = this.page(page, Wrappers.lambdaQuery(BeanUtil.copyProperties(rpcAgentLevelModel, AgentLevelModel.class)));
//        HashMap<String, Object> map = new HashMap<>();
//        map.put("current", modelIPage.getCurrent());
//        map.put("size", modelIPage.getSize());
//        map.put("records", modelIPage.getRecords().parallelStream().map(m -> BeanUtil.copyProperties(m, RpcAgentLevelModel.class)).collect(Collectors.toList()));
//        map.put("total", modelIPage.getTotal());
//        return map;
//    }

//    @Override
//    public List<RpcAgentLevelModel> rpcList(RpcAgentLevelModel rpcAgentLevelModel, Integer size) {
//        List<AgentLevelModel> agentLevelModels = this.selectList(Wrappers.lambdaQuery(BeanUtil.copyProperties(rpcAgentLevelModel, AgentLevelModel.class)), size);
//        return agentLevelModels.parallelStream().map(m -> BeanUtil.copyProperties(m, RpcAgentLevelModel.class)).collect(Collectors.toList());
//    }
//
//    @Override
//    public RpcAgentLevelModel rpcAdd(RpcAgentLevelModel rpcAgentLevelModel) {
//        AgentLevelModel agentLevelModel = this.insert(BeanUtil.copyProperties(rpcAgentLevelModel, AgentLevelModel.class));
//        return BeanUtil.copyProperties(agentLevelModel, RpcAgentLevelModel.class);
//    }
//
//    @Override
//    public Boolean rpcDelete(List<String> ids) {
//        return agentLevelMapper.deleteBatchIds(ids) > 0;
//    }
//
//    @Override
//    public RpcAgentLevelModel rpcGetById(String id) {
//        return BeanUtil.copyProperties(this.getById(id), RpcAgentLevelModel.class);
//    }
}
